#include "aiHelper.h"
#include "position.h"

bool aiHelper::shouldMoveUp(const ObjectId& objId) {
	const Position* ballPosition = static_cast<const Position*>(GameObjectSystem::GetSingleton().getProperty(Position::POSITION_ID, "ball1"));
	const Position* bumperPosition = static_cast<const Position*>(GameObjectSystem::GetSingleton().getProperty(Position::POSITION_ID, objId));
	matrix ballMat, bumperMat;
	ballMat = ballPosition->getPosition();
	bumperMat = bumperPosition->getPosition();
	vector3 ballTranslation, bumperTranslation;
	GetTranslation(ballMat, &ballTranslation);
	GetTranslation(bumperMat, &bumperTranslation);
	return ballTranslation.y > bumperTranslation.y;
}

bool aiHelper::shouldMoveDown(const ObjectId& objId) {
	return !shouldMoveUp(objId);
}